﻿@model yq.WebModel.Sys.User
@Url.Css("Css/metro/css/list.css")
@Url.Script("Scripts/metro/info.js")
@Url.UploadScript()
@Url.TreeScript()
<script>
    function OnSuccessForm(obj)
    {
        if (obj.Status == 1)
        {
            window.location = window.location;
        } else
        {
            $.tips(obj.ErrorText);
        }
    }
</script>
<div id="container" class="container">
    @Html.Action("Navigation", "Home")
    @Html.Action("RowLeft", "PublicReuse", new { Area = "Home", back = true })
    <div id="container_r" class="container_right">
        @Html.Action("HeadTitle", "PublicReuse", new { Area = "Home" })
        <div class="icodiv">
        </div>
        <div class="span8" style="padding-top: 0px">
            @using (Ajax.BeginForm("DoEidtUser", new { }, new AjaxOptions { OnSuccess = "OnSuccessForm" }, new { @class = "form-horizontal", novalidate = "novalidate" }))
            { 
    
                @Html.HiddenFor(obj => obj.Account.UserId)
                <fieldset>
                    <div class="alert alert-info" style="margin-top: 0px; margin-bottom: 20px; text-align: left">
                        账号信息
                    </div>
                    <div class="control-group">
                        <div>
                            <label class="control-label">@Html.RawFor(obj => obj.Account.NickName)</label>
                            <div class="controls">
                                @Html.TextBoxFor(obj => obj.Account.NickName)
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            @Html.RawFor(obj => obj.Account.CreateTtime)</label>
                        <div class="controls">
                            <label class="txt">
                                @Model.Account.CreateTtime.ToString("yyyy-MM-dd")</label>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="disabledInput">
                            @Html.RawFor(obj => obj.Account.PurviewEnum)</label>
                        <div class="controls">
                            @Html.SelectEnumFor(obj => obj.Account.PurviewEnum, yq.Enums.UserAccount.PurviewEnum.Default)
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="optionsCheckbox2">
                            @Html.RawFor(obj => obj.Account.State)</label>
                        <div class="controls">
                            @Html.SelectEnumFor(obj => obj.Account.State, yq.Enums.UserAccount.State.Default)
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="optionsCheckbox2">
                            可登录账号</label>
                        <div class="controls">
                            <label class="txt">
                                @foreach (var log in Model.Login)
                                {
                                    <a id="UserLogin_@(log.Rowid)" href='@(Url.Action("EidtLogin", new { logId = log.Rowid }))' class="label  label-info" 
                            alt="登录账号" onclick="return $.DialogAjax(this)">@(log.Account)
                                    </a> 
                                    @Html.Raw("&nbsp;&nbsp;&nbsp;") 
                                }
                                <a href='@(Url.Action("AddLogin", new { UserId = Model.Account.UserId }))' onclick="return $.DialogAjax(this,CloseAllError)"
                      class="label  label-important">添 加</a>
                            </label>
                          
                        </div>
                    </div>
                    <div class="alert alert-info" style="margin-top: 0px; margin-bottom: 20px; text-align: left">
                        用户信息
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            @Html.RawFor(obj => obj.Info.Name)</label>
                        <div class="controls">
                            @Html.TextBoxFor(obj => obj.Info.Name)
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            @Html.RawFor(obj => obj.Info.Title)</label>
                        <div class="controls">
                            @Html.TextBoxFor(obj => obj.Info.Title)
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label">
                            @Html.RawFor(obj => obj.Info.DepartmentId)</label>
                        <div class="controls">
                            @Html.DoubleDialog(obj => obj.Info.DepartmentId, Url.Action("SelectDepartment", "Department"), Model.DepartmentName)
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label">
                            @Html.RawFor(obj => obj.Info.Gender)</label>
                        <div class="controls">
                            @Html.SelectEnumFor(obj => obj.Info.Gender)
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            @Html.RawFor(obj => obj.Info.Email)</label>
                        <div class="controls">
                            @Html.TextBoxFor(obj => obj.Info.Email)
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            @Html.RawFor(obj => obj.Info.Address)</label>
                        <div class="controls">
                            @Html.TextBoxFor(obj => obj.Info.Address)
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            @Html.RawFor(obj => obj.Info.DateBirth)</label>
                        <div class="controls">
                            @Html.TimeFor(obj => obj.Info.DateBirth, HtmlExtensions.DatePickerFmt.yyyyMMdd)
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            @Html.RawFor(obj => obj.Info.Summary)</label>
                        <div class="controls">
                            @Html.TextAreaFor(obj => obj.Info.Summary, new { cols = "5", rows = "5", style = " width:400px" })
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            @Html.RawFor(obj => obj.Info.HeadFlieId)</label>
                        <div class="controls">
                            @Html.ImgFile(Model.Info.HeadFlieId, 200, 50, 50, new { id = "ImgFileLogo" })
                            @Html.UploadFor(obj => obj.Info.HeadFlieId, new UploadConfig() { Callback = "ImgFileLogofun" }, UploadType.Img, Model.Account.UserId)
                            <script>
                                function ImgFileLogofun()
                                {
                                    $("#ImgFileLogo").hide();
                                }
                            </script>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                        </label>
                        <div class="controls">
                            @Html.Submit(" 保 存")
                        </div>
                    </div>
                </fieldset>  
            }
        </div>
    </div>
</div>
